@keyframes fx-loading-animation-spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fx-loading-animation-wave {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.fx-loading {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;

  > .fx-loading-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    transform: translateX(-50%) translateY(-50%);

    > .fx-loading-wave {
      width: 100%;
      min-width: 60px;
      height: 60px;
      position: relative;

      > li {
        width: 50px;
        height: 50px;
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        box-sizing: border-box;
        border-radius: 50%;
        border: 2px solid #47ebeb;
        animation: fx-loading-animation-wave 1.5s infinite ease;
        transform: scale(0);

        @for $i from 0 through 4 {
          &:nth-of-type(#{$i+1}) {
            animation-delay: 600ms*$i;
          }
        }
      }
    }

    > .fx-loading-rainbow {
      width: 100%;
      min-width: 60px;
      height: 60px;
      position: relative;
      transform: rotate(-45deg);

      > li {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        border-radius: 50%;
        border: 2px solid transparent;
        animation: fx-loading-animation-spin 1.5s cubic-bezier(.175, .885, .32, 1.275) infinite;

        @for $i from 1 through 5 {
          &:nth-of-type(#{$i}) {
            width: 10px * $i;
            height: 10px * $i;
            animation-delay: -100ms*$i;
            @if $i==5 {
              border-top-color: #eb4747;
              border-right-color: #eb4747;
            }
            @if $i==4 {
              border-top-color: #ebeb47;
              border-right-color: #ebeb47;
            }
            @if $i==3 {
              border-top-color: #47eb47;
              border-right-color: #47eb47;
            }
            @if $i==2 {
              border-top-color: #47ebeb;
              border-right-color: #47ebeb;
            }
            @if $i==1 {
              border-top-color: #4747eb;
              border-right-color: #4747eb;
            }
          }
        }
      }
    }

    > .fx-loading-text {
      height: 24px;
      line-height: 24px;
      white-space: nowrap;
      text-align: center;
    }
  }
}
